<template>
  <div class="pageWrapper">
    <common-header />
    <div class="content" v-if="ready">
      <van-tabs v-model="active" color="#1B68EB" title-inactive-color="#CCCCCC" title-active-color="#1F1F1F" :line-width="58" :line-height="2">
        <van-tab title="我的考核结果">
          <result-list :type="1" />
        </van-tab>
        <van-tab title="单位结果公示">
          <result-list :type="2" />
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
import resultList from "./components/result-list.vue";
export default {
  name: "appraisalResults",
  components: {
    resultList
  },
  beforeRouteEnter(to, from, next) {
    if (from.name == "Year" || !from.name || from.name == "Normal") {
      next(vm => {
        vm.active = 0;
        vm.ready = false;
        vm.$nextTick(() => {
          vm.ready = true;
        });
      });
    } else {
      next(vm => {
        if (vm.ready == false) {
          vm.ready = true;
        }
      });
    }
  },
  data() {
    return {
      active: 0,
      ready: false
    };
  },
  methods: {}
};
</script>

<style scoped lang="scss"></style>
